import*as t from"../../core/common/common.js";import*as e from"../../core/root/root.js";import*as o from"../../core/sdk/sdk.js";import*as i from"../../models/workspace/workspace.js";import*as a from"../../ui/legacy/components/utils/utils.js";import*as n from"../../ui/legacy/legacy.js";import*as r from"../../core/i18n/i18n.js";const s={focusDebuggee:"Focus debuggee",toggleDrawer:"Toggle drawer",nextPanel:"Next panel",previousPanel:"Previous panel",reloadDevtools:"Reload DevTools",restoreLastDockPosition:"Restore last dock position",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoomLevel:"Reset zoom level",searchInPanel:"Search in panel",cancelSearch:"Cancel search",findNextResult:"Find next result",findPreviousResult:"Find previous result",theme:"Theme:",switchToSystemPreferredColor:"Switch to system preferred color theme",systemPreference:"System preference",switchToLightTheme:"Switch to light theme",lightCapital:"Light",switchToDarkTheme:"Switch to dark theme",darkCapital:"Dark",darkLower:"dark",lightLower:"light",panelLayout:"Panel layout:",useHorizontalPanelLayout:"Use horizontal panel layout",horizontal:"horizontal",useVerticalPanelLayout:"Use vertical panel layout",vertical:"vertical",useAutomaticPanelLayout:"Use automatic panel layout",auto:"auto",colorFormat:"Color format:",setColorFormatAsAuthored:"Set color format as authored",asAuthored:"As authored",setColorFormatToHex:"Set color format to HEX",setColorFormatToRgb:"Set color format to RGB",setColorFormatToHsl:"Set color format to HSL",enableCtrlShortcutToSwitchPanels:"Enable Ctrl + 1-9 shortcut to switch panels",enableShortcutToSwitchPanels:"Enable ⌘ + 1-9 shortcut to switch panels",right:"Right",dockToRight:"Dock to right",bottom:"Bottom",dockToBottom:"Dock to bottom",left:"Left",dockToLeft:"Dock to left",undocked:"Undocked",undockIntoSeparateWindow:"Undock into separate window",devtoolsDefault:"DevTools (Default)",language:"Language:",browserLanguage:"Browser UI language",enableSync:"Enable settings sync",colorFormatSettingDisabled:"This setting is deprecated because it is incompatible with modern color spaces. To re-enable it, disable the corresponding experiment.",searchAsYouTypeSetting:"Search as you type",searchAsYouTypeCommand:"Enable search as you type",searchOnEnterCommand:"Disable search as you type (press Enter to search)"},l=r.i18n.registerUIStrings("entrypoints/main/main-meta.ts",s),c=r.i18n.getLazilyComputedLocalizedString.bind(void 0,l);let g,d;async function u(){return g||(g=await import("./main.js")),g}function m(t){return()=>r.i18n.getLocalizedLanguageRegion(t,r.DevToolsLocale.DevToolsLocale.instance())}n.ActionRegistration.registerActionExtension({category:n.ActionRegistration.ActionCategory.DRAWER,actionId:"inspector_main.focus-debuggee",loadActionDelegate:async()=>(await async function(){return d||(d=await import("../inspector_main/inspector_main.js")),d}()).InspectorMain.FocusDebuggeeActionDelegate.instance(),order:100,title:c(s.focusDebuggee)}),n.ActionRegistration.registerActionExtension({category:n.ActionRegistration.ActionCategory.DRAWER,actionId:"main.toggle-drawer",loadActionDelegate:async()=>n.InspectorView.ActionDelegate.instance(),order:101,title:c(s.toggleDrawer),bindings:[{shortcut:"Esc"}]}),n.ActionRegistration.registerActionExtension({actionId:"main.next-tab",category:n.ActionRegistration.ActionCategory.GLOBAL,title:c(s.nextPanel),loadActionDelegate:async()=>n.InspectorView.ActionDelegate.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+]"},{platform:"mac",shortcut:"Meta+]"}]}),n.ActionRegistration.registerActionExtension({actionId:"main.previous-tab",category:n.ActionRegistration.ActionCategory.GLOBAL,title:c(s.previousPanel),loadActionDelegate:async()=>n.InspectorView.ActionDelegate.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+["},{platform:"mac",shortcut:"Meta+["}]}),n.ActionRegistration.registerActionExtension({actionId:"main.debug-reload",category:n.ActionRegistration.ActionCategory.GLOBAL,title:c(s.reloadDevtools),loadActionDelegate:async()=>(await u()).MainImpl.ReloadActionDelegate.instance(),bindings:[{shortcut:"Alt+R"}]}),n.ActionRegistration.registerActionExtension({category:n.ActionRegistration.ActionCategory.GLOBAL,title:c(s.restoreLastDockPosition),actionId:"main.toggle-dock",loadActionDelegate:async()=>n.DockController.ToggleDockActionDelegate.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+Shift+D"},{platform:"mac",shortcut:"Meta+Shift+D"}]}),n.ActionRegistration.registerActionExtension({actionId:"main.zoom-in",category:n.ActionRegistration.ActionCategory.GLOBAL,title:c(s.zoomIn),loadActionDelegate:async()=>(await u()).MainImpl.ZoomActionDelegate.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+Plus",keybindSets:["devToolsDefault","vsCode"]},{platform:"windows,linux",shortcut:"Ctrl+Shift+Plus"},{platform:"windows,linux",shortcut:"Ctrl+NumpadPlus"},{platform:"windows,linux",shortcut:"Ctrl+Shift+NumpadPlus"},{platform:"mac",shortcut:"Meta+Plus",keybindSets:["devToolsDefault","vsCode"]},{platform:"mac",shortcut:"Meta+Shift+Plus"},{platform:"mac",shortcut:"Meta+NumpadPlus"},{platform:"mac",shortcut:"Meta+Shift+NumpadPlus"}]}),n.ActionRegistration.registerActionExtension({actionId:"main.zoom-out",category:n.ActionRegistration.ActionCategory.GLOBAL,title:c(s.zoomOut),loadActionDelegate:async()=>(await u()).MainImpl.ZoomActionDelegate.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+Minus",keybindSets:["devToolsDefault","vsCode"]},{platform:"windows,linux",shortcut:"Ctrl+Shift+Minus"},{platform:"windows,linux",shortcut:"Ctrl+NumpadMinus"},{platform:"windows,linux",shortcut:"Ctrl+Shift+NumpadMinus"},{platform:"mac",shortcut:"Meta+Minus",keybindSets:["devToolsDefault","vsCode"]},{platform:"mac",shortcut:"Meta+Shift+Minus"},{platform:"mac",shortcut:"Meta+NumpadMinus"},{platform:"mac",shortcut:"Meta+Shift+NumpadMinus"}]}),n.ActionRegistration.registerActionExtension({actionId:"main.zoom-reset",category:n.ActionRegistration.ActionCategory.GLOBAL,title:c(s.resetZoomLevel),loadActionDelegate:async()=>(await u()).MainImpl.ZoomActionDelegate.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+0"},{platform:"windows,linux",shortcut:"Ctrl+Numpad0"},{platform:"mac",shortcut:"Meta+Numpad0"},{platform:"mac",shortcut:"Meta+0"}]}),n.ActionRegistration.registerActionExtension({actionId:"main.search-in-panel.find",category:n.ActionRegistration.ActionCategory.GLOBAL,title:c(s.searchInPanel),loadActionDelegate:async()=>(await u()).MainImpl.SearchActionDelegate.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+F",keybindSets:["devToolsDefault","vsCode"]},{platform:"mac",shortcut:"Meta+F",keybindSets:["devToolsDefault","vsCode"]},{platform:"mac",shortcut:"F3"}]}),n.ActionRegistration.registerActionExtension({actionId:"main.search-in-panel.cancel",category:n.ActionRegistration.ActionCategory.GLOBAL,title:c(s.cancelSearch),loadActionDelegate:async()=>(await u()).MainImpl.SearchActionDelegate.instance(),order:10,bindings:[{shortcut:"Esc"}]}),n.ActionRegistration.registerActionExtension({actionId:"main.search-in-panel.find-next",category:n.ActionRegistration.ActionCategory.GLOBAL,title:c(s.findNextResult),loadActionDelegate:async()=>(await u()).MainImpl.SearchActionDelegate.instance(),bindings:[{platform:"mac",shortcut:"Meta+G",keybindSets:["devToolsDefault","vsCode"]},{platform:"windows,linux",shortcut:"Ctrl+G"},{platform:"windows,linux",shortcut:"F3",keybindSets:["devToolsDefault","vsCode"]}]}),n.ActionRegistration.registerActionExtension({actionId:"main.search-in-panel.find-previous",category:n.ActionRegistration.ActionCategory.GLOBAL,title:c(s.findPreviousResult),loadActionDelegate:async()=>(await u()).MainImpl.SearchActionDelegate.instance(),bindings:[{platform:"mac",shortcut:"Meta+Shift+G",keybindSets:["devToolsDefault","vsCode"]},{platform:"windows,linux",shortcut:"Ctrl+Shift+G"},{platform:"windows,linux",shortcut:"Shift+F3",keybindSets:["devToolsDefault","vsCode"]}]}),t.Settings.registerSettingExtension({category:t.Settings.SettingCategory.APPEARANCE,storageType:t.Settings.SettingStorageType.Synced,title:c(s.theme),settingName:"uiTheme",settingType:t.Settings.SettingType.ENUM,defaultValue:"systemPreferred",reloadRequired:!1,options:[{title:c(s.switchToSystemPreferredColor),text:c(s.systemPreference),value:"systemPreferred"},{title:c(s.switchToLightTheme),text:c(s.lightCapital),value:"default"},{title:c(s.switchToDarkTheme),text:c(s.darkCapital),value:"dark"}],tags:[c(s.darkLower),c(s.lightLower)]}),t.Settings.registerSettingExtension({category:t.Settings.SettingCategory.APPEARANCE,storageType:t.Settings.SettingStorageType.Synced,title:c(s.panelLayout),settingName:"sidebarPosition",settingType:t.Settings.SettingType.ENUM,defaultValue:"auto",options:[{title:c(s.useHorizontalPanelLayout),text:c(s.horizontal),value:"bottom"},{title:c(s.useVerticalPanelLayout),text:c(s.vertical),value:"right"},{title:c(s.useAutomaticPanelLayout),text:c(s.auto),value:"auto"}]}),t.Settings.registerSettingExtension({category:t.Settings.SettingCategory.APPEARANCE,storageType:t.Settings.SettingStorageType.Synced,title:c(s.colorFormat),settingName:"colorFormat",settingType:t.Settings.SettingType.ENUM,defaultValue:"original",options:[{title:c(s.setColorFormatAsAuthored),text:c(s.asAuthored),value:"original"},{title:c(s.setColorFormatToHex),text:"HEX: #dac0de",value:"hex",raw:!0},{title:c(s.setColorFormatToRgb),text:"RGB: rgb(128 255 255)",value:"rgb",raw:!0},{title:c(s.setColorFormatToHsl),text:"HSL: hsl(300deg 80% 90%)",value:"hsl",raw:!0}],deprecationNotice:{disabled:!0,warning:c(s.colorFormatSettingDisabled),experiment:e.Runtime.ExperimentName.DISABLE_COLOR_FORMAT_SETTING}}),t.Settings.registerSettingExtension({category:t.Settings.SettingCategory.APPEARANCE,storageType:t.Settings.SettingStorageType.Synced,settingName:"language",settingType:t.Settings.SettingType.ENUM,title:c(s.language),defaultValue:"en-US",options:[{value:"browserLanguage",title:c(s.browserLanguage),text:c(s.browserLanguage)},...r.i18n.getAllSupportedDevToolsLocales().sort().map((t=>{return{value:e=t,title:m(e),text:m(e)};var e}))],reloadRequired:!0}),t.Settings.registerSettingExtension({category:t.Settings.SettingCategory.APPEARANCE,storageType:t.Settings.SettingStorageType.Synced,title:c(s.enableCtrlShortcutToSwitchPanels),titleMac:c(s.enableShortcutToSwitchPanels),settingName:"shortcutPanelSwitch",settingType:t.Settings.SettingType.BOOLEAN,defaultValue:!1}),t.Settings.registerSettingExtension({category:t.Settings.SettingCategory.GLOBAL,settingName:"currentDockState",settingType:t.Settings.SettingType.ENUM,defaultValue:"right",options:[{value:"right",text:c(s.right),title:c(s.dockToRight)},{value:"bottom",text:c(s.bottom),title:c(s.dockToBottom)},{value:"left",text:c(s.left),title:c(s.dockToLeft)},{value:"undocked",text:c(s.undocked),title:c(s.undockIntoSeparateWindow)}]}),t.Settings.registerSettingExtension({storageType:t.Settings.SettingStorageType.Synced,settingName:"activeKeybindSet",settingType:t.Settings.SettingType.ENUM,defaultValue:"devToolsDefault",options:[{value:"devToolsDefault",title:c(s.devtoolsDefault),text:c(s.devtoolsDefault)},{value:"vsCode",title:r.i18n.lockedLazyString("Visual Studio Code"),text:r.i18n.lockedLazyString("Visual Studio Code")}]}),t.Settings.registerSettingExtension({category:t.Settings.SettingCategory.SYNC,settingName:"sync_preferences",settingType:t.Settings.SettingType.BOOLEAN,title:c(s.enableSync),defaultValue:!1,reloadRequired:!0}),t.Settings.registerSettingExtension({storageType:t.Settings.SettingStorageType.Synced,settingName:"userShortcuts",settingType:t.Settings.SettingType.ARRAY,defaultValue:[]}),t.Settings.registerSettingExtension({category:t.Settings.SettingCategory.GLOBAL,storageType:t.Settings.SettingStorageType.Local,title:c(s.searchAsYouTypeSetting),settingName:"searchAsYouType",settingType:t.Settings.SettingType.BOOLEAN,order:3,defaultValue:!0,options:[{value:!0,title:c(s.searchAsYouTypeCommand)},{value:!1,title:c(s.searchOnEnterCommand)}]}),n.ViewManager.registerLocationResolver({name:"drawer-view",category:n.ViewManager.ViewLocationCategory.DRAWER,loadResolver:async()=>n.InspectorView.InspectorView.instance()}),n.ViewManager.registerLocationResolver({name:"drawer-sidebar",category:n.ViewManager.ViewLocationCategory.DRAWER_SIDEBAR,loadResolver:async()=>n.InspectorView.InspectorView.instance()}),n.ViewManager.registerLocationResolver({name:"panel",category:n.ViewManager.ViewLocationCategory.PANEL,loadResolver:async()=>n.InspectorView.InspectorView.instance()}),n.ContextMenu.registerProvider({contextTypes:()=>[i.UISourceCode.UISourceCode,o.Resource.Resource,o.NetworkRequest.NetworkRequest],loadProvider:async()=>a.Linkifier.ContentProviderContextMenuProvider.instance(),experiment:void 0}),n.ContextMenu.registerProvider({contextTypes:()=>[Node],loadProvider:async()=>n.XLink.ContextMenuProvider.instance(),experiment:void 0}),n.ContextMenu.registerProvider({contextTypes:()=>[Node],loadProvider:async()=>a.Linkifier.LinkContextMenuProvider.instance(),experiment:void 0}),n.Toolbar.registerToolbarItem({separator:!0,location:n.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_LEFT,order:100,showLabel:void 0,actionId:void 0,condition:void 0,loadItem:void 0}),n.Toolbar.registerToolbarItem({separator:!0,order:97,location:n.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_RIGHT,showLabel:void 0,actionId:void 0,condition:void 0,loadItem:void 0}),n.Toolbar.registerToolbarItem({loadItem:async()=>(await u()).MainImpl.SettingsButtonProvider.instance(),order:99,location:n.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_RIGHT,showLabel:void 0,condition:void 0,separator:void 0,actionId:void 0}),n.Toolbar.registerToolbarItem({loadItem:async()=>(await u()).MainImpl.MainMenuItem.instance(),order:100,location:n.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_RIGHT,showLabel:void 0,condition:void 0,separator:void 0,actionId:void 0}),n.Toolbar.registerToolbarItem({loadItem:async()=>n.DockController.CloseButtonProvider.instance(),order:101,location:n.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_RIGHT,showLabel:void 0,condition:void 0,separator:void 0,actionId:void 0}),t.AppProvider.registerAppProvider({loadAppProvider:async()=>(await u()).SimpleApp.SimpleAppProvider.instance(),order:10,condition:void 0});
